import { ref } from "vue";
import { defineStore } from "pinia";
import type { Menu } from "@/types/menu";
export const useAdminMenuStore = defineStore(
  "admin-menu",
  () => {
    const menuList = ref<Menu[]>([
      {
        id: 1,
        title: "首页",
        path: "/admin/home",
        icon: 'IconCalendar',
      },
      {
        id: 2,
        title: "用户管理",
        path: "/admin/user",
        icon: 'IconCalendar',
        children: [
          {
            id: 21,
            title: "用户列表",
            path: "/admin/user",
          },
          {
            id: 22,
            title: "用户权限",
            path: "/admin/user/right",
          },
        ],
      },
    ]);
    return { menuList };
  },
  {
    persist: {
      paths: ["menuList"],
    },
  }
);
export const useMenuStore = defineStore(
  "menu",
  () => {
    const menuList = ref<Menu[]>([]);
    return { menuList };
  },
  {
    persist: {
      paths: ["menuList"],
    },
  }
);
